/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.DeliveryRecipientPlace;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

import java.util.List;

public interface DeliveryRecipientPlaceMapper {
    /* @mbggenerated */
    @Delete({
        "delete from delivery_recipient_place",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /* @mbggenerated */
    @Insert({
        "insert into delivery_recipient_place (recipient_province_code, recipient_province_name, ",
        "recipient_city_code, recipient_city_name, ",
        "recipient_district_code, recipient_district_name, ",
        "create_user, create_time, ",
        "upd_user, upd_time)",
        "values (#{recipientProvinceCode,jdbcType=VARCHAR}, #{recipientProvinceName,jdbcType=VARCHAR}, ",
        "#{recipientCityCode,jdbcType=VARCHAR}, #{recipientCityName,jdbcType=VARCHAR}, ",
        "#{recipientDistrictCode,jdbcType=VARCHAR}, #{recipientDistrictName,jdbcType=VARCHAR}, ",
        "#{createUser,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updUser,jdbcType=INTEGER}, #{updTime,jdbcType=TIMESTAMP})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(DeliveryRecipientPlace record);

    /* @mbggenerated */
    @InsertProvider(type=DeliveryRecipientPlaceSqlProvider.class, method="insertSelective")
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insertSelective(DeliveryRecipientPlace record);

    /* @mbggenerated */
    @Select({
        "select",
        "id, recipient_province_code, recipient_province_name, recipient_city_code, recipient_city_name, ",
        "recipient_district_code, recipient_district_name, create_user, create_time, ",
        "upd_user, upd_time",
        "from delivery_recipient_place"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="recipient_province_code", property="recipientProvinceCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="recipient_province_name", property="recipientProvinceName", jdbcType=JdbcType.VARCHAR),
        @Result(column="recipient_city_code", property="recipientCityCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="recipient_city_name", property="recipientCityName", jdbcType=JdbcType.VARCHAR),
        @Result(column="recipient_district_code", property="recipientDistrictCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="recipient_district_name", property="recipientDistrictName", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_user", property="createUser", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="upd_user", property="updUser", jdbcType=JdbcType.INTEGER),
        @Result(column="upd_time", property="updTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<DeliveryRecipientPlace> selectAll();

    /* @mbggenerated */
    @UpdateProvider(type=DeliveryRecipientPlaceSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(DeliveryRecipientPlace record);

    /* @mbggenerated */
    @Update({
        "update delivery_recipient_place",
        "set recipient_province_code = #{recipientProvinceCode,jdbcType=VARCHAR},",
          "recipient_province_name = #{recipientProvinceName,jdbcType=VARCHAR},",
          "recipient_city_code = #{recipientCityCode,jdbcType=VARCHAR},",
          "recipient_city_name = #{recipientCityName,jdbcType=VARCHAR},",
          "recipient_district_code = #{recipientDistrictCode,jdbcType=VARCHAR},",
          "recipient_district_name = #{recipientDistrictName,jdbcType=VARCHAR},",
          "create_user = #{createUser,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "upd_user = #{updUser,jdbcType=INTEGER},",
          "upd_time = #{updTime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(DeliveryRecipientPlace record);
}